www.gusucode.com > 星梦奇缘交友网 1 > 星梦奇缘交友网 1.0源码程序/love/search.asp

    <!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<%
 '=========================================================
' File: search.asp
' Version:3.0
' Date: 2005-11-3
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ:10689579 Msn:zdlmicr@hotmail.com
'=========================================================
dim Srs,sqls,sqlstr
response.buffer=true
stats="分类搜索"
call nav()
if not founduser then
	Errmsg=Errmsg+"<br>"+"<li>您还没有登陆,请登陆后进行修改。"
	founderr=true
end if

if founderr then
	call Mslove_error()
else
call tumppages()'翻页处理
response.Write("<table width=""750"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0""><TR bordercolor=""#111111"" bgcolor=""#ffffff"" class=""tableborder1""><TD vAlign=bottom background=skins/21cn/search_bg.gif height=50><P align=right><IMG height=50 src=""skins/21cn/search.gif"" width=142 border=0></P></TD></TR></table>")
Select Case Trim(Request("action"))
	Case "Usearch"
		Stats="会员搜索结果"
		call Userlist()
	Case "psearch"
		Stats="约会搜索结果"
		call partlist()
	Case "dsearch"
		Stats="日记搜索结果"
		call diarlist()
	case "asearch"
		Stats="文章搜索结果"
		call artlist()
	case else	
		call main()
End Select
if founderr then call Mslove_error()
end if
call activeonline()
call footer()

sub main()%>
<style type="text/css">
<!--
.style5 {color: #000000}
.style6 {color: #0000FF}
-->
</style>


<TABLE width=750 border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR> 
      <TD style="WIDTH: 193px; LINE-HEIGHT: 20pt" vAlign=top width=193> <P><FONT face=宋体><FONT color=dimgray><FONT 
            style="FONT-SIZE: 10.5pt"><STRONG>∷友情提醒</STRONG></FONT><STRONG><FONT 
            color=dimgray 
            size=3>∷<BR>
          </FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </STRONG></FONT>爱情大搜索 <BR>
          <FONT size=1>● </FONT>结果过多,则应限制搜索条件。 <BR>
          <FONT size=1>● </FONT>结果太少,则应放宽限制条件。 <BR>
          <FONT size=1>● </FONT>设定征友要求有助于找到两情相悦的朋友。 <BR>
          <FONT size=1>● </FONT>搜索出结果,还要行动,建议积极发信。 <br>
          <FONT size=1>● </FONT></FONT>VIP会员在分类搜索中有更高的权限,可以搜索:被锁定用户、等级比自已高的用户、锁定文章、未审约会及日记等!</P></TD>
      <TD vAlign=top> <TABLE style="WIDTH: 540px" cellSpacing=0 cellPadding=5 width=540 
            align=center border=0>
          <TBODY>
            <TR> 
              <TD style="WIDTH: 301px" vAlign=top align=middle width=301> <TABLE cellSpacing=1 cellPadding=0 width="100%" align=center 
                  bgColor=#e5dafb border=0>
                  <TBODY>
                    <TR> 
                      <TD> <TABLE id=Table1 cellSpacing=0 cellPadding=3 
                        width="100%" align=center border=0>
						<form action="?action=Usearch" method=POST name="theForm">
                          <TBODY>
                            <TR> 
                              <TD align=right width="26%" height=30>性 别:</TD>
                              <TD width="74%" height=30> <P><SPAN id=rad_Sex> 
                                  <INPUT id=rad_Sex_0 type=radio 
                              CHECKED value=0 name=Gender>
                                  <LABEL 
                              for=rad_Sex_0>女</LABEL>
                                  <INPUT id=rad_Sex_1 
                              type=radio value=1 name=Gender>
                                  <LABEL 
                              for=rad_Sex_1>男</LABEL>
                                  </SPAN></P></TD>
                            </TR>
                            <TR> 
                              <TD align=right width="26%" height=30>年 龄:</TD>
                              <TD width="74%" height=30> <P> 
                                  <select name="Minage" id="Minage">
                                    <option selected></option>
                                    <option value=0>0</option>
                                    <option 
                          value=15>15</option>
                                    <option value=20 >20</option>
                                    <option value=25>25</option>
                                    <option value=30>30</option>
                                    <option 
                          value=35>35</option>
                                    <option value=40>40</option>
                                    <option value=45>45</option>
                                    <option 
                          value=50>50</option>
                                    <option value=55>55</option>
                                    <option value=60>60</option>
                                    <option 
                          value=65>65</option>
                                    <option 
                        value=70>70</option>
                                  </select>
                                  到 
                                  <select name="Maxage" id="Maxage">
                                    <option selected></option>
                                    <option 
                          value=70>70</option>
                                    <option value=65>65</option>
                                    <option value=60>60</option>
                                    <option 
                          value=55>55</option>
                                    <option value=50>50</option>
                                    <option value=45>45</option>
                                    <option 
                          value=40>40</option>
                                    <option value=35>35</option>
                                    <option value=30>30</option>
                                    <option 
                          value=25>25</option>
                                    <option value=20>20</option>
                                    <option value=15>15</option>
                                    <option value=0>0</option>
                                  </select>
                                  岁</P></TD>
                            </TR>
                            <TR> 
                              <TD align=right width="26%" height=30>身 高:</TD>
                              <TD width="74%" height=30> <P> 
                                  <select name=Minheight id="Minheight">
                                    <option selected></option>
                                    <option value=110>110</option>
                                    <option value=150>150</option>
                                    <option value=155>155</option>
                                    <option value=160>160</option>
                                    <option value=165>165</option>
                                    <option value=170>170</option>
                                    <option value=175>175</option>
                                    <option value=180>180</option>
                                    <option value=185>185</option>
                                    <option value=190>190</option>
                                    <option value=195>195</option>
                                    <option value=200>200</option>
                                  </select>
                                  到 
                                  <select name=Maxheight id="Maxheight">
                                    <option selected></option>
                                    <option value=200>200</option>
                                    <option value=195>195</option>
                                    <option value=190>190</option>
                                    <option value=185>185</option>
                                    <option value=180>180</option>
                                    <option value=175>175</option>
                                    <option value=170>170</option>
                                    <option value=165>165</option>
                                    <option value=160>160</option>
                                    <option value=155>155</option>
                                    <option value=150>150</option>
                                    <option value=110>110</option>
                                  </select>
                                  CM </P></TD>
                            </TR>
                            <TR> 
                              <TD align=right width="26%" height=30>婚姻状况:</TD>
                              <TD width="74%" height=30><select size=1 name=marital>
            <option selected></option>
            <option value=未婚>未婚</option>
            <option value=已婚>已婚</option>
            <option value=离异>离异</option>
            <option value=丧偶>丧偶</option>
          </select></TD>
                            </TR>
                            <TR> 
                              <TD align=right width="26%" height=30>民 族:</TD>
                              <TD width="74%" height=30><select name=Folk>
              <option></option>
              <option value=汉族>汉族</option>
			  <option value=藏族>藏族</option>
			  <option value=朝鲜族>朝鲜族</option>
			  <option value=蒙古族>蒙古族</option>
			  <option value=回族>回族</option>
			  <option value=满族>满族</option>
			  <option value=维吾尔族>维吾尔族</option>
			  <option value=壮族>壮族</option>
			  <option value=彝族>彝族</option>
			  <option value=苗族>苗族</option>
			  <option value=其他民族>其他民族</option> 
            </select></TD>
                            </TR>
                            <TR> 
                              <TD align=right width="26%" height=30>学 历:</TD>
                              <TD width="74%" height=30> <P> 
                                  <select size=1 name=education>
            <option></option>
            <option value=小学>小学</option>
            <option value=初中>初中</option>
            <option value=高中>高中</option>
            <option value=中专>中专</option>
            <option value=大专>大专</option>
            <option value=大学>大学</option>
            <option value=硕士>硕士</option>
            <option value=博士>博士</option>
            <option value=其它>其它</option>
          </select>
                                </P></TD>
                            </TR>
                            <TR> 
                              <TD align=right width="26%" height=30>会员姓名:</TD>
                              <TD width="74%" height=30><FONT face=宋体> 
                                <input name="SearchUser" type="text" id="SearchUser" size="20" maxlength="20">
                                </FONT></TD>
                            </TR>
                            <TR> 
                              <TD align=right width="26%" height=30>照 片:</TD>
                              <TD width="74%" height=30><LABEL 
                              for=chkPhoto> 
                                <select name=Userpics id="Userpics">
                                  <option value="" selected></option>
                                  <option value=1>有照片</option>
                                  <option value=0>无照片</option>
                                </select>
                                </LABEL></TD>
                            </TR>
                            <TR> 
                              <TD align=right width="26%" height=30>身 份:</TD>
                              <TD width="74%" height=30> <P> 
                                  <select name=status id="status">
                                    <option value="" selected></option>
                                    <option value=1>普通会员</option>
                                    <option value=2>VIP会员</option>
                                  </select>
                                </P></TD>
                            </TR>
                            <TR> 
                              <TD style="HEIGHT: 18px" align=right width="26%" 
                            height=18>登录时间:</TD>
                              <TD style="HEIGHT: 18px" width="74%" 
                              height=18><SELECT id=Loginday name=Loginday>
                                    <OPTION selected></OPTION>
                                  <OPTION 
                                value=3>三天内登录过</OPTION>
                                  <OPTION 
                                value=7>一周内登录过</OPTION>
                                  <OPTION 
                                value=15>半月内登录过</OPTION>
                                  <OPTION 
                                value=30>一个月内登录过</OPTION>
                                  <OPTION 
                                value=100>三个月内登录过</OPTION>
                                  <OPTION 
                                value=180>半年内登录过</OPTION>
                                </SELECT></TD>
                            </TR>
                            <TR> 
                              <TD width="26%" height=15 align=right><FONT 
                              face=宋体>注册日期:</FONT></TD>
                              <TD width="74%" height=15><SELECT id=JoinDate 
                              name=JoinDate>
                                  <OPTION selected></OPTION>
                                  <%
Dim uploadpath,ii
for ii=0 to datediff("m","2005-1",Now())
uploadpath=DateAdd("m",-ii,Now())
uploadpath=year(uploadpath)&"-"&month(uploadpath)
response.write "<option value="""&uploadpath&""">"&year(uploadpath)&"年"&month(uploadpath)&"月</option>"
next
%>
                                </SELECT></TD>
                            </TR>
                            <TR>
                                <TD width="26%" height=15 align=right>&nbsp;</TD>
                                <TD height=15> <FONT face=宋体> 
                                  <input name="likes" type="checkbox" id="likes" value="1">
                                完全区配</FONT></TD>
                            </TR>
                            <TR> 
                              <TD align=right colSpan=2 height=37> <P align=center> 
                                  <INPUT id=bnt_Search style="WIDTH: 55px; HEIGHT: 25px" type=submit value=" 搜 索 " name=bnt_Search>
                                </P></TD>
                            </TR>
                          </TBODY>
						  </form>
                        </TABLE></TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
              <TD vAlign=top align=middle width=250 height=150> <TABLE borderColor=#111111 height=47 cellSpacing=0 
                  cellPadding=0 width="100%" align=center border=0>
                  <TBODY>
                    <TR bgColor=#ddccff> 
                      <TD width="100" height=22>&nbsp;<FONT 
                        face=Arial color=#333333> 同城约会搜索</FONT></TD>
                    </TR>
                    <TR> <script language="JavaScript" src="inc/Mymodify.js"></script> 
                      <TD align=left bgColor=#f7efff height=25>
                        <table  class=tableborder2 cellspacing=0 cellpadding=3 width="100%" border=0>
                          <form action="?action=psearch" method=POST name="parForm">
                            <tbody>
                              <tr> 
                                <td height="15" align=left>标 题: 
                                  <input name="Ptitle" type="text" id="Ptitle" size="18" maxlength="100"> 
                                  <br>
                                  性 别: 
                                  <select name=Gender id="Gender">
                                    <option value="" selected></option>
                                    <option value="1">男性</option>
                                    <option value="0">女性</option>
                                    <option value="2">不限</option>
                                  </select> <br>
                                  类 型: 
                                  <input name="Ispublic" type="radio" value="0">
                                  公开 
                                  <input type="radio" name="Ispublic" value="1">
                                  单独 </td>
                              </tr>
                              <tr> 
                                <td height="15" align=left>省份: 
                                  <input type=text name=province size=8> <select name="selectp" onChange="selectcityarea('selectp','selectc','parForm');parForm.province.value=this.value;">
                                    <option value="0" selected>请选择..</option>
                                  </select> <br>
                                  城市: 
                                  <input type=text name=city size=8> <select name="selectc" onChange="parForm.city.value=this.value;">
                                    <option value="0" selected>请选择..</option>
                                  </select> </td>
                              </tr>
                              <tr> 
                                <td height="34" align=left>发 起 人: 
                                  <input name="partname" type="text" id="partname" size="12" maxlength="20"> 
                                  <br> <input name="likes" type="checkbox" id="likes" value="1">
                                  完全区配<br>
                                  日期: 
                                  <input name=Partydate type=text size="15"> 
                                  <input name=submit type=submit id="submit" value="搜 索"> 
                                </td>
                              </tr>
                          </form>
                        </table>
                        <script>
first("selectp","selectc","parForm",0,0);
</script> </TD>
                    </TR>
                  </TBODY>
                </TABLE>
                <TABLE borderColor=#111111 height=84 cellSpacing=0 
                  cellPadding=0 width="100%" align=center border=0>
                  <TBODY>
                    <TR bgColor=#ddccff> 
                      <TD width="260" height=22 bgcolor="#ddccff">&nbsp;<FONT face=Arial 
                        color=#333333> 会员日记搜索</FONT></TD>
                    </TR>
                    <TR> 
                      <TD bgColor=#f7efff height=30><table  class=tableborder2 cellspacing=0 cellpadding=3 width="100%" border=0>
                          <form action="?action=dsearch" method=POST name="theForm">
                            <tbody>
                              <tr> 
                                <td height="30" align=left>日记标题: 
                                  <input name="Ptitle" type="text" id="Ptitle" size="18" maxlength="100"> 
                                </td>
                              </tr>
                              <tr> 
                                <td height="34" align=left>日记写手: 
                                  <input name="postname" type="text" id="postname" size="15" maxlength="20"> 
                                  <br> <input name="likes" type="checkbox" id="likes" value="1">
                                  完全区配 <br> <input type="hidden" name="style" value="2">
                                  几天之内发表: 
                                  <input name="diaryday" type="text" id="diaryday" size="3" maxlength="5"> 
                                  <input type=submit value="搜 索" name=submit2></td>
                              </tr>
                          </form>
                        </table></TD>
                    </TR>
                    <TR> 
                      <TD bgColor=#ddccff height=22><FONT face=Arial 
                        color=#333333>&nbsp; </FONT>玫瑰文章搜索</TD>
                    </TR>
                    <TR> 
                      <TD bgColor=#f7efff height=10> 
                        <table  class=tableborder2 cellspacing=0 cellpadding=3 width="100%" border=0>
                          <form action="?action=asearch" method=POST name="theForm">
                            <tbody>
                              <tr> 
                                <td height="30" align=left>关 键 词: 
                                  <input name="keyword" type="text" id="keyword" size="15" maxlength="100"> 
                                  <select name="sclass" id="sclass">
                                    <option value="" selected></option>
                                    <option value="1">标题</option>
                                    <option value="2">全文</option>
                                  </select> <input type=submit value="搜 索" name=submit3> 
                                </td>
                              </tr>
                          </form>
                        </table></TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
            </TR>
          </TBODY>
        </TABLE></TD>
    </TR>
  </TBODY>
</TABLE>
<%
end sub

sub Userlist()''会员搜索开始
dim Gender,Minage,Maxage,Minheight,Maxheight,Userpics,userstatus
dim orders,ordername,Starname,StarVip,likes
dim stat,OnlineTime,SearchUser,Loginday,splitfriend
dim min_byear,max_byear,Min_hei,Max_hei,marital,Folk,education,JoinDate,thistime


sqlstr=""
SearchUser=checkStr(trim(request("SearchUser")))
likes=checkStr(trim(request("likes")))
Gender=checkStr(trim(request("Gender")))
Minage=checkStr(trim(request("Minage")))
Maxage=checkStr(trim(request("Maxage")))
Minheight=checkStr(trim(request("Minheight")))
Maxheight=checkStr(trim(request("Maxheight")))
Userpics=checkStr(trim(request("Userpics")))
userstatus=checkStr(trim(request("status")))
Loginday=checkStr(trim(request("Loginday")))
marital=checkStr(trim(request("marital")))
Folk=checkStr(trim(request("Folk")))
education=checkStr(trim(request("education")))
JoinDate=checkStr(trim(request("JoinDate")))
if SearchUser<>"" then''搜索会员名称
  if sqlstr="" then
	if likes="" then
       sqlstr=" Username like '%"&SearchUser&"%'"
  	else
       sqlstr=" Username='"&SearchUser&"' "
  	end if
else
    if likes="" then
       sqlstr=sqlstr& " and Username like '%"&SearchUser&"%' "
    else
        sqlstr=sqlstr& " and Username='"&SearchUser&"' "
    end if
 end if
end if
if Minage<>"" and Maxage<>"" then
   if Minage>Maxage then'判断年龄
      min_byear=year(date)-Minage
      max_byear=year(date)-Maxage
   else
      min_byear=year(date)-Maxage
      max_byear=year(date)-Minage
   end if
end if
   if Minage<>"" and Maxage<>"" then
     	if sqlstr="" then
        	sqlstr=" (year(Userbirthday) between "&min_byear&" and "&max_byear&") "
	    else
	    	sqlstr=sqlstr& " and (year(Userbirthday) between "&min_byear&" and "&max_byear&") "
	   	end if
   end if

if Gender<>"" then''性别搜索
  	if sqlstr="" then
  	  	sqlstr=" usersex="&Gender&" "
  	else
  	  	sqlstr=sqlstr& " and usersex="&Gender&" "
  	end if
end if
if Userpics<>"" then
if Userpics=1 then''照片搜索
  	if sqlstr="" then
  	  	sqlstr=" UserPics>0 "
  	else
  	  	sqlstr=sqlstr& " and UserPics>0 "
  	end if
elseif Userpics=0 then
	  	if sqlstr="" then
  	  	sqlstr=" UserPics=0 "
  	else
  	  	sqlstr=sqlstr& " and UserPics=0 "
  	end if
end if
end if

if userstatus<>"" then''VIP会员
  	if sqlstr="" then
  	  	if userstatus=1 then
  	  	  	sqlstr=" UserVip<="&userstatus&" "
  	  	else
  	  	  	sqlstr=" UserVip>="&userstatus&" "
  	  	end if
  	else
  	  	if userstatus=1 then
  	   		sqlstr=sqlstr& " and UserVip<="&userstatus&" "
  	  	else
  	   		sqlstr=sqlstr& " and UserVip>="&userstatus&" "
   		end if
  	end if
end if

if Minheight<Maxheight then
  	Min_hei=Minheight
  	Max_hei=Maxheight
else
  	Min_hei=Maxheight
  	Max_hei=Minheight
end if
   if Min_hei<>"" and Max_hei<>"" then
     	if sqlstr="" then
        	sqlstr=" (Userheight between "&Min_hei&" and "&Max_hei&") "
	    else
	    	sqlstr=sqlstr& " and (Userheight between "&Min_hei&" and "&Max_hei&") "
	    end if
   end if
   
if Loginday<>"" then
  	if sqlstr="" then
	'此处折磨了我好久,最后才发现问题所在。原来SQL与ACESS中,关于获得当前日期的方法不同。SQL语句中用的是函数getdate()
	'而ACESS中用的是函数NOW()来获取。此外,还需要将下面变量SqlNowString改动成" & SqlNowString & "才最终调试通过。
  	  	sqlstr=" datediff(d,LastLogin," & SqlNowString & ")<"&Loginday&" "
  	else
  	  	sqlstr=sqlstr& " and datediff(d,LastLogin," & SqlNowString & ")<"&Loginday&" "
  	end if
end if
if JoinDate<>"" then
  	if sqlstr="" then
  	  	'sqlstr=" cdate(year(JoinDate)-month(JoinDate))="&JoinDate&" "  '此处是ACESS数据库所用
  	    'sqlstr=" convert(datetime,(year(JoinDate)-month(JoinDate)),111)="&JoinDate&" "   '此处是SQL数据库所用
	     sqlstr=" cast((year(JoinDate)-month(JoinDate)) AS char(50))= "&JoinDate&" " 
	else
  	  	'sqlstr=sqlstr& " and cdate(year(JoinDate)-month(JoinDate))="&JoinDate&" " '此处是ACESS数据库所用
  	     'sqlstr=sqlstr& " and convert(datetime,(year(JoinDate)-month(JoinDate)),111)="&JoinDate&" " '此处是SQL数据库所用
	     sqlstr=sqlstr& " and cast((year(JoinDate)-month(JoinDate)) AS char(50)) ="&JoinDate&" "
	end if
end if
if marital<>"" then
  	if sqlstr="" then
  	  	sqlstr=" UserInfo like '%"&marital&"%' "
  	else
  	  	sqlstr=sqlstr& " and UserInfo like '%"&marital&"%'  "
  	end if
end if
if Folk<>"" then
  	if sqlstr="" then
  	  	sqlstr=" UserInfo like '%"&Folk&"%' "
  	else
  	  	sqlstr=sqlstr& " and UserInfo like '%"&Folk&"%'  "
  	end if
end if
if education<>"" then
  	if sqlstr="" then
  	  	sqlstr=" UserInfo like '%"&education&"%' "
  	else
  	  	sqlstr=sqlstr& " and UserInfo like '%"&education&"%'  "
  	end if
end if

if sqlstr="" then
  	errmsg=errmsg+"<br>"+"<li>搜索条件不能为空。"
	founderr=true
	exit sub
end if
strFileName="search.asp?action="&Request("action")&"&SearchUser="&SearchUser&"&likes="&likes&"&Minage="&Minage&"&Maxage="&Maxage&"&Gender="&Gender&"&Userpics="&Userpics&"&status="&userstatus&"&Minheight="&Minheight&"&Maxheight="&Maxheight&"&Loginday="&Loginday&"&JoinDate="&JoinDate&"&marital="&marital&"&Folk="&Folk&"&education="&education&""
%>
<p></p>
<TABLE class=BgSearch borderColor=#111111 cellSpacing=1 
            cellPadding=2 width="750" align=center border=0>
  <TBODY>
    <TR> 
      <TD width=150 background=Skins/21cn/bg9.gif 
                  height=20><B>&nbsp;搜索结果</B> </TD>
    </TR>
    <TR> 
      <TD vAlign=top align=middle bgColor=#ffffff>      <table width="95%" border="0" align=center cellspacing=0 cellpadding=0>
        <tr align="center" bgcolor="#FFFFFF">
          <tr align="center">
          <td height="29" align="left"  class=tablebody1 colspan="12">
		    <br>
          </tr>
        <%
	
	set rs=server.createobject("adodb.recordset")
	if Supermaster or master or standmaster  or Vipuser then
		sql="select userid,LockUser,Username,UserFace,UserVip,Usersex,Userbirthday,UserPics,Userdiary,UserInfo,Userfriends,Userart,UserViews,userclass  from [Ms_user] where "&sqlstr&" order by userid"
		else
		sql="select userid,LockUser,Username,UserFace,UserVip,Usersex,Userbirthday,UserPics,Userdiary,UserInfo,Userfriends,Userart,UserViews,userclass from [Ms_user] where "&sqlstr&" and LockUser=0 order by userid"
		end if
	rs.Open sql,conn,1,1
	if  rs.eof or rs.bof then
		response.write "<tr><td colspan=10 class=tablebody1 align=center>还没有任何用户数据。</td></tr>"
	else
call rspages()
	do while not rs.eof and page_count<Cint(MaxPerPage)
	dim StarUserFace
	dim userinfo_hpf,province_hpf,city_hpf,Umarital_hpf,Ueducation_hpf,occupation_hpf,personal_hpf
    StarUserFace= rs("UserFace")
    Starname=rs("Username")
	StarVip=rs("UserVip")
	
    userinfo_hpf=split(rs("UserInfo"),"|||")
	province_hpf=userinfo_hpf(4)  '省份
	city_hpf=userinfo_hpf(5)        '城市
	occupation_hpf=userinfo_hpf(11)      '职业
	Umarital_hpf=userinfo_hpf(13)    '婚姻状况
	Ueducation_hpf=userinfo_hpf(14)   '学历
	personal_hpf=userinfo_hpf(2) 	'个人独白
	
	dim Userfriendinfo_hpf,Ufigure_hpf,Uincome_hpf
    Userfriendinfo_hpf=split(rs("Userfriends"),"|||")	
   

		Ufigure_hpf=Userfriendinfo_hpf(2)   '体型
		Uincome_hpf=Userfriendinfo_hpf(5)   '收入


	
if Supermaster or master then
	set Srs=conn.execute("select stats,startime from Ms_online where userid="&rs("userid"))
	else
	set Srs=conn.execute("select stats,startime from Ms_online where userid="&rs("userid")&" and userhidden=2")
	end if
	if Srs.eof and Srs.bof then
	stat=""
	OnlineTime="[离线]"
	else
	stat="当前位置:["&Srs(0)&"]"
	OnlineTime="[在线:" & datediff("n",Srs(1),Now()) & "Mins]"
	end if
	Srs.close
	set Srs=nothing
%>
        <tr bgcolor="#FFFFFF">
          <td width=20% height="54" class=tablebody1>&nbsp;
            <div align="center">
                <p><img src="<%=StarUserFace%>" alt="" name="fs" align="middle">
</p>
                <p>人气:<%=rs("UserViews")%></p>
                <p>&nbsp;&nbsp;</p>
            </div></td>
          <td width=76% height="27" class=tablebody1>
            <p>&nbsp; &nbsp;<a href=../dispuser.asp?Username=<%=Starname%> ><%=Starname%><a><%if StarVip>1 then
	response.write("&nbsp;<img src=Skins/Default/vip.gif title=Vip会员>")
	end if
	if rs("LockUser")=1 then
		response.write "&nbsp;<img src=Skins/Default/userlock.gif title=锁定状态 align=absmiddle>"
	elseif rs("LockUser")=2 then
		response.write "&nbsp;<img src=Skins/Default/useroff.gif title=屏蔽状态 align=absmiddle>"
	end if%>
            </a><a>,
	<%if rs("Usersex")=1 then
	response.Write("<img src=skins/21cn/boy.gif>")
   else
	response.Write("<img src=skins/21cn/girl.gif>")
 end if%>   		
			
              &nbsp;&nbsp;&nbsp;&nbsp;<%if stat<>"" then
	response.write("<img src=Skins/Default/online1.gif title="&stat&OnlineTime&">")
	else
	response.write("<img src=Skins/Default/offline1.gif title="&OnlineTime&">")
	end if%>
            </a></p>
            <p><a>&nbsp;&nbsp;&nbsp;&nbsp;<%if rs("Usersex")=1 then
response.write("男")
else
response.write("女")
end if%>
            ,<%=datediff("yyyy",rs("Userbirthday"),Now())%>岁,<%=province_hpf%><%=city_hpf%>  
	        ,<%=Ueducation_hpf%>,<%=Umarital_hpf%>,身材<%=Ufigure_hpf%>,<%=Uincome_hpf%>元,</a><%=occupation_hpf%>,<span class="style5">等级</span>:<%=rs("userclass")%>,            </p>
            <p>&nbsp;&nbsp;&nbsp;<strong>个人独白</strong>:<%=personal_hpf%>&nbsp;&nbsp;&nbsp;<a></p>
              <p align="right">
                <a href="javascript:openScript('messanger.asp?action=new&touser=<%=htmlencode(Starname)%>',500,400)" class="style6">明送秋波</a>&nbsp;&nbsp;&nbsp;<a href="friendlist.asp?action=addF&myFriend=<%=HTMLEncode(Starname)%>" target=_blank class="style6">加为好友</a>&nbsp;&nbsp;&nbsp;<a href="userbook.asp?action=add&ClassID=2&Touser=<%=HTMLEncode(Starname)%>" target=_blank class="style6">发送留言</a>&nbsp;&nbsp;&nbsp; <a href=photolist.asp?action=userp&username=<%=Starname%> target=_blank>个人相册</a>&nbsp;&nbsp;&nbsp; <a href=../dispuser.asp?Username=<%=Starname%> class="style6" target=_blank>详细资料&gt;&gt;&gt;</a></p>
</td>
        </tr>
<TD style="BORDER-BOTTOM: #cccccc 1px dashed" 
                                colSpan=3 
                            height=2>&nbsp;</TD>				
        <%page_count=page_count+1
	rs.movenext
	loop
	end if
	rs.close
  if totalrec>0 then%>
        <tr align="center">
          <td height="29" align="left"  class=tablebody1 colspan="12">
		    <%
		  	call showpage(strFileName)
		  %>
          </td>
        </tr>
        <%end if%>
      </table></TD>
    </TR>
  </TBODY>
</TABLE>
<p></p>
<%
end sub

sub partlist()''同城约会开始
dim Ptitle,province,city,partname,Partydate,Gender,Ispublic,likes
partname=checkStr(trim(request("partname")))
likes=trim(request("likes"))
Gender=trim(request("Gender"))
Ptitle=trim(request("Ptitle"))
province=trim(request("province"))
city=trim(request("city"))
Partydate=trim(request("Partydate"))
Ispublic=trim(request("Ispublic"))
sqlstr=""
if partname<>"" then''搜索会员名称
  	if likes="" then
  	  	sqlstr=" Username like '%"&partname&"%' "
  	else
  	  	sqlstr=sqlstr& "and Username='"&partname&"' "
  	end if
end if
if province<>"" then
  	if sqlstr="" then
  	  	sqlstr=" Province like '%"&province&"%' "
  	else
  	  	sqlstr=sqlstr& " and Province like '%"&province&"%' "
  	end if
end if
if City<>"" then
  	if sqlstr="" then
   		sqlstr=" Province like '%"&city&"%' "
  	else
  	  	sqlstr=sqlstr& " and Province like '%"&city&"%' "
  	end if
end if
if Gender<>"" then
  	if sqlstr="" then
  	  	sqlstr=" Parsex="&Gender&" "
  	else
  	  	sqlstr=sqlstr& " and Parsex="&Gender&" "
  	end if
end if
if Ptitle<>"" then
  	if sqlstr="" then
  	  	sqlstr=" Title like '%"&Ptitle&"%' "
  	else
  	  	sqlstr=sqlstr& " and Title like '%"&Ptitle&"%' "
  	end if
end if
if Partydate<>"" then
  	if sqlstr="" then
  	  	If IsSqlDataBase=1 Then
  	  	  	sqlstr=" PartyDate='"&Partydate&"' "
  	  	else
  	  	  	sqlstr=" PartyDate=#"&PartyDate&"#"
  	  	end if
  	else
  	  	If IsSqlDataBase=1 Then
  	  	sqlstr=sqlstr&" and PartyDate='"&PartyDate&"'"
  	  	else
  	  	sqlstr=sqlstr&" and PartyDate=#"&PartyDate&"#"
    	end if
  	end if
end if
if Ispublic<>"" then
  	if sqlstr="" then
  	  	sqlstr=" Ispublic="&Ispublic&" "
  	else
  	  	sqlstr=sqlstr& " and Ispublic="&Ispublic&" "
  	end if
end if
if sqlstr="" then
  	errmsg=errmsg+"<br>"+"<li>搜索条件不能为空。"
	founderr=true
	exit sub
end if
strFileName="search.asp?action="&Request("action")&"&partname="&partname&"&likes="&likes&"&province="&province&"&city="&city&"&Gender="&Gender&"&Ptitle="&Ptitle&"&Partydate="&Partydate&"&Ispublic="&Ispublic&""
%>
<TABLE class=BgSearch borderColor=#111111 cellSpacing=1 
            cellPadding=2 width="750" align=center border=0>
  <TBODY>
    <TR> 
      <TD width=150 background=Skins/21cn/bg9.gif 
                  height=20><B>&nbsp;搜索结果</B> </TD>
    </TR>
    <TR> 
      <TD vAlign=top align=middle bgColor=#ffffff><table width="748" border="0" align="center" cellpadding="0" cellspacing="0" >
          <tr align="center"> 
            <td height="31" >约会名称</td>
            <td width="9%" >城市</td>
            <td width="12%" >昵称</td>
            <td width="12%" >约会日期</td>
            <td width="11%" >性 质</td>
            <td width="13%" >要 求</td>
            <td width="10%" >约会/响应</td>
            <td width="6%" >人气</td>
          </tr>
          <%dim Pid,Userage,Typeid,parsex
  set rs=server.createobject("adodb.recordset")
   if Supermaster or master or Standmaster or Vipuser then
  sql="select pid,Title,City,username,Maxnum,Userjoin,Minage,Maxage,Parsex,PartyDate,Typeid,hits,Addtime from Ms_party where "&sqlstr&" order by addtime desc"
  else
  sql="select pid,Title,City,username,Maxnum,Userjoin,Minage,Maxage,Parsex,PartyDate,Typeid,hits,Addtime from Ms_party where "&sqlstr&" and Checked=1 order by addtime desc"
  end if
rs.Open sql,conn,1,1
if not (rs.eof and rs.bof) then
call rspages()
do while not rs.eof and page_count<Cint(MaxPerPage)
Pid=rs("Pid")
City=rs("City")
Typeid=rs("Typeid")
parsex=rs("Parsex")%>
          <tr> 
            <td height="28"  class=tablebody1>&nbsp;<a href=partyshow.asp?Pid=<%=pid%> title=浏览约会内容><%=rs("Title")%></a> <%if datediff("d",rs("Addtime"),date())<=1 then
response.write("&nbsp;<img src=images/new.gif>")
end if%> </td>
            <td align="center"  class=tablebody1><%=city%></td>
            <td align="center"  class=tablebody1><a href=dispuser.asp?username=<%=rs("username")%>><%=rs("username")%></a></td>
            <td align="center"  class=tablebody1><%=datevalue(rs("PartyDate"))%></td>
            <td align="center"  class=tablebody1> <%if Typeid=1 then
	response.write("征友")
	elseif Typeid=2 then
	response.write("恋人")
	elseif Typeid=3 then
	response.write("节日")
	elseif Typeid=4 then
	response.write("纪念")
	elseif Typeid=5 then
	response.write("旅游")
	else
	response.write("其它")
	end if%> </td>
            <td align="center"  class=tablebody1> <%if parsex=2 then
	response.Write("无要求")
	elseif parsex=1 then
	response.Write("男")
	else
	response.Write("女")
	end if%>
              (<%=rs("Minage")%>-<%=rs("Maxage")%>)</td>
            <td align="center"  class=tablebody1><%=rs("Maxnum")%> / <font color=red><%=rs("Userjoin")%></font></td>
            <td align="center"  class=tablebody1> <%if rs("hits")>=Clicknums then
	response.write("<font color=red>"&rs("hits")&"</font>")
	else
	response.write(""&rs("hits")&"")
	end if%> </td>
          </tr>
          <%page_count=page_count+1
  rs.movenext
  loop
  end if
  rs.close
  if totalrec>0 then%>
          <tr align="center"> 
            <td height="29" align="left"  class=tablebody1 colspan="8"> <%
		  	call showpage(strFileName)
		  %> </td>
          </tr>
          <%end if%>
        </table> </TD>
    </TR>
  </TBODY>
</TABLE>
<%
end sub

sub diarlist()
dim Did,Tdiary,istop,postname,style
dim ptitle,username,diaryday,likes,addtime
postname=checkStr(trim(request("postname")))
diaryday=checkStr(trim(request("diaryday")))
Ptitle=checkStr(trim(request("Ptitle")))
likes=checkStr(trim(request("likes")))
addtime=checkStr(trim(request("addtime")))
style=checkStr(trim(request("style")))
sqlstr=""
strFileName="search.asp?action="&Request("action")&"&username="&postname&"&likes="&likes&"&Ptitle="&Ptitle&"&diaryday="&diaryday&"&addtime="&request("addtime")&"&style="&request("style")&""
if postname<>"" then
  	if likes="" then
		sqlstr=" username like '%"&postname&"%' "
  	else
     	sqlstr=" username='"&postname&"' "
  	end if
end if
if Ptitle<>"" then
  	if style=2 then
  	  	if sqlstr="" then
  	  	sqlstr=" Title like '%"&Ptitle&"%' "
  	  	else
  	  	sqlstr=sqlstr&" and Title like '%"&Ptitle&"%' "
  	  	end if
  	else
  	  	if sqlstr="" then
  	  	  	sqlstr=" Username like '%"&Ptitle&"%' "
  	  	else
  	  	  	sqlstr=sqlstr&" and Username like '%"&Ptitle&"%' "
  	  	end if
  	end if
end if
if diaryday<>"" then
  	if sqlstr="" then
  	  	sqlstr=" datediff('d',Datetime,Now())<"&diaryday&" "
  	else
  	  	sqlstr=sqlstr&" and datediff('d',Datetime,Now())<"&diaryday&" "
  	end if
end if
if addtime<>"" then
  	if sqlstr="" then
  	  	If IsSqlDataBase=1 Then
  	  	  	sqlstr=" Datetime='"&addtime&"'"
  	  	else
  	  	  	sqlstr=" Datetime=#"&addtime&"#"
  	  	end if
  	else
  	  	If IsSqlDataBase=1 Then
  	  	sqlstr=sqlstr&" and Datetime='"&addtime&"'"
  	  	else
  	  	sqlstr=sqlstr&" and Datetime=#"&addtime&"#"
    	end if
  	end if
end if
if sqlstr="" then
  	errmsg=errmsg+"<br>"+"<li>搜索条件不能为空。"
	founderr=true
	exit sub
end if
%>
<TABLE class=BgSearch borderColor=#111111 cellSpacing=1 
            cellPadding=2 width="750" align=center border=0>
  <TBODY>
    <TR> 
      <TD width=150 background=Skins/21cn/bg9.gif 
                  height=20><B>&nbsp;搜索结果</B> </TD>
    </TR>
    <TR> 
      <TD vAlign=top align=middle bgColor=#ffffff><table width="746" border="0" align=center cellpadding=0 cellspacing=0 >
          <tr align="center"> 
            <td width="5%" height="27" >状态</td>
            <td width="43%" >日记主题</td>
            <td width="11%" >作者</td>
            <td width="6%" >天气</td>
            <td width="7%" >人气</td>
            <td width="7%" >评论</td>
            <td width="21%" >最后更新</td>
          </tr>
          <%
  set rs=server.createobject("adodb.recordset")
  if Supermaster or master or standmaster  or Vipuser then
    sql="select did,Topic,Title,Addtime,Username,Weather,hits,Disdiary,Lasttime,LastPost,istop from Ms_diary where "&sqlstr&" order by Istop desc,Did"
	else
	sql="select did,Topic,Title,Addtime,Username,Weather,hits,Disdiary,Lasttime,LastPost,istop from Ms_diary where "&sqlstr&" and Checked=1 order by Istop desc,Did"
	end if
rs.Open sql,conn,1,1
if not (rs.eof and rs.bof) then
call rspages()
Tdiary=0
do while not rs.eof and page_count<Cint(MaxPerPage)
Did=rs("Did")
Tdiary=Tdiary+1
istop=rs("istop")
postname=rs("Username")
%>
          <tr align="center"> 
            <td width="5%" align="center"  > <%if istop=2 then
	  response.write("<img src=Skins/Default/istop.gif width=17 height=17 border=0 align=""absmiddle"" title=""固顶日记"">")
elseif istop=1 then
response.write("<img src=Skins/Default/isbest.gif width=17 height=17 border=0 align=""absmiddle"" title=""精华日记"">")
else
response.write("<img src=Skins/Default/folder.gif width=17 height=17 border=0 align=""absmiddle"" title=""开放日记"">")
end if%> </td>
            <td width="43%" align="left"  class=tablebody1><img src=<%=rs("Topic")%> width=20 border=0 align="absmiddle"> 
              <%response.write("<a href=diaryview.asp?Did="&Did&" title=""主题:"&rs("Title")&Brstrt&"作者:"&postname&Brstrt&"发表于:"&rs("Addtime")&""" target=_blank>"&left(rs("Title"),24)&"</a>")
	  if datediff("d",rs("Addtime"),date())<1 then
response.write("&nbsp;<img src=images/new.gif>")
end if%> </td>
            <td width="11%" align="center"  ><a href=dispuser.asp?username=<%=postname%>><%=postname%></a></td>
            <td align="center"  class=tablebody1><img src=Skins/Default/weather/<%=rs("Weather")%>.gif border=0 width=13></td>
            <td width="7%" align="center"  class=tablebody1> <%if rs("hits")>=Clicknums then
	response.write("<font color=red>"&rs("hits")&"</font>")
	else
	response.write(""&rs("hits")&"")
	end if%> </td>
            <td width="7%" align="center"  class=tablebody1><%=rs("Disdiary")%></td>
            <td align="center"  ><%=replace(rs("Lasttime"),right(rs("Lasttime"),3),"")%> <font color=red>|</font> <a href=dispuser.asp?username=<%=rs("LastPost")%>><%=rs("LastPost")%></a></td>
          </tr>
          <%page_count=page_count+1
  rs.movenext
  loop
  else
  response.write("<tr align=""center""><td height=""30"" colspan=""7"" align=""center""  class=tablebody1>没有搜索到日记,请选择其它关键词!</td></tr>")
  end if
  rs.close
  if totalrec>0 then%>
          <tr align="center"> 
            <td height="29" align="left"  class=tablebody1 colspan="7"> <%
		  	call showpage(strFileName)
		  %> </td>
          </tr>
          <%end if%>
        </table></TD>
    </TR>
  </TBODY>
</TABLE>
<%
end sub

sub artlist()''文章搜索开始
dim keyword,sclass
keyword=checkStr(trim(request("keyword")))
sclass=checkStr(trim(request("sclass")))
if sclass="" then
sclass=1
end if
strFileName="search.asp?action="&Request("action")&"&keyword="&keyword&"&sclass="&sclass&""
if Keyword<>"" then
if sclass=1 then
sqlstr=" Title like '%"&Keyword&"%' "
elseif sclass=2 then
sqlstr=" Content like '%"&Keyword&"%' "
end if
end if
if sqlstr="" then
  	errmsg=errmsg+"<br>"+"<li>搜索条件不能为空。"
	founderr=true
	exit sub
end if%>
<TABLE class=BgSearch borderColor=#111111 cellSpacing=1 
            cellPadding=2 width="748" align=center border=0>
  <TBODY>
    <TR> 
      <TD width=150 background=Skins/21cn/bg9.gif 
                  height=20><B>&nbsp;搜索结果</B> </TD>
    </TR>
    <TR> 
      <TD vAlign=top align=middle bgColor=#ffffff><table width="746" border="0" align=center cellpadding=0 cellspacing=0>
          <%dim Istop,Lastpostlist
	set rs=server.createobject("adodb.recordset")
	if Supermaster or master or standmaster  or Vipuser then
    sql="select id,title,Username,Hits,Ubbs,Addtime,Boardid from Ms_Article where "&sqlstr&" and locktopic=0 order by id desc"
	else
	sql="select id,title,Username,Hits,Ubbs,Addtime,Boardid from Ms_Article where "&sqlstr&" and Checked=1 order by id desc"
	end if
	rs.Open sql,conn,1,1
if not (rs.eof and rs.bof) then
call rspages()
do while not rs.eof and page_count<Cint(MaxPerPage)%>
          <tr align="center"> 
            <td height="24" align="left"  class=tablebody1>&nbsp;<img src=images/artimg/list_nav_spacer.gif> 
              <%response.write("<a href=showart.asp?Boardid="&rs(6)&"&ID="&rs(0)&" title=""主题:"&rs(1)&Brstrt&"发表于:"&rs(5)&""" target=_blank>"&left(rs(1),22)&"</a>")
	  if datediff("d",rs(5),date())<1 then
response.write("&nbsp;<img src=images/new.gif>")
end if%>
              [<%=datevalue(rs(5))%>]</td>
          </tr>
          <%page_count=page_count+1
	rs.movenext
  loop
  else
  response.write("<tr align=""center""><td height=""30"" colspan=""1"" align=""center""  class=tablebody1>无记录!</td></tr>")
  end if
  rs.close
  if totalrec>0 then%>
          <tr align="center"> 
            <td height="29" align="left"  class=tablebody1> <%
		  	call showpage(strFileName)
		  %> </td>
          </tr>
          <%end if%>
        </table></TD>
    </TR>
  </TBODY>
</TABLE>
<%
end sub
%>
</body>
</html>